#include <iostream>
#include <unistd.h>
#include <cstring>
using namespace std;

int main(int agrc, const char* argv[])
{
  if (agrc < 2)
  {
    cout << "指令输入错误" << endl;
    exit(-1);
  }

  cout << "获取环境变量env_23:" << getenv("env_23") << endl;

  int i = 1;
  while(argv[i])
  {
    if (strcmp(argv[i], "-l") == 0)
    {
      i++;
    cout << "hello, -l"<< endl;
    }else if (strcmp(argv[i], "-a") == 0)
    {
      i++;
    cout << "hello, -a" << endl;
    }else 
    {
      i++;
    cout << "没有发现文件" << endl;
    }
  }
  return 0;
}




